package org.kernely.stream.administration;

import org.kernely.stream.persistence.Stream;
import org.kernely.ui.mvp.KernelyPresenter;

public class StreamInformationsPresenter extends KernelyPresenter<StreamInformationsView>{

	/**
	 * The Stream to edit in edition mode
	 */
	private Stream stream;
	private boolean editMode = false;
	
	public StreamInformationsPresenter(){
		
	}
	
	/**
	 * Default constructor.
	 * @param s The stream to describe.
	 */
	public StreamInformationsPresenter(Stream s){
		this.stream = s;
		this.editMode = true;
	}
	
	/**
	 * Bind method, where we fill view data.
	 */
	@Override
	public final void bind() {
		if(editMode && stream != null){
			this.view.getTitle().setValue(stream.getTitle());
		}
	}

}
